/*
 * @Author: TC
 * @Date: 2025-06-10 10:04:11
 * @Last Modified by: TC
 * @Last Modified time: 2025-06-10 11:20:15
 */

import { IBaseInterface } from "../../Interface/BaseInterface";
import { app } from "../../App";
import { EntityComponent } from "./EntityComponent";

export class EntityUnit implements IBaseInterface {
    constructor(comp: EntityComponent) {
        this._comp = comp;
        app.tickMgr.add(this);
    }

    //唯一标识
    private _uid: number = -1;
    public set uid(id: number) {
        this._uid = id;
    }
    public get uid(): number {
        return this._uid;
    }

    //组件
    private _comp: EntityComponent = null;
    public get comp(): EntityComponent {
        return this._comp;
    }

    public tick(dt: number): void {
        this._comp.tick(dt);
    }
    release(): void {
        throw new Error("Method not implemented.");
    }
}
